﻿using Phidgets;

namespace Coding4Fun.BoxingBots.Robot
{
	public class SensorController : PhidgetInterfaceController
	{
		//public event EventHandler<SensorDataChangedEventArgs> SensorDataChanged;

		internal SensorController(InterfaceKit phidgetInterfaceKit) : base(phidgetInterfaceKit)
		{
			PhidgetInterfaceKit.ratiometric = true;
		}

		public int PollAnalogInput(int index)
		{
			return PhidgetInterfaceKit.sensors[index].Value;
		}

		public bool PollDigitalInput(int index)
		{
			return PhidgetInterfaceKit.inputs[index];
		}

		public override void Dispose()
		{
			//PhidgetInterfaceKit.SensorChange -= PhidgetInterfaceKitSensorChange;

			base.Dispose();
		}
	}
}
